import Vue from 'vue'
import Router from 'vue-router'
import Msite from '@/components/Msite'
import Discover from '@/components/Discover'
import Order from '@/components/Order'
import Profile from '@/components/Profile'
import Food from '@/components/Food'
import Shop from '@/components/Shop'
import Login from '@/components/login'
import Note from '@/components/note'
import Password from '@/components/password'
import Ulike from '@/components/ulike'
import Search from '@/components/search'
import About from '@/components/about'
import SearchTxt from '@/components/searchTxt'
import SearchList from '@/components/searchList'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/msite'
    },
    {
      path: '/msite',
      component: Msite
    },
    {
      path: '*',
      redirect: '/msite'
    },
    {
      path: '/discover',
      component: Discover
    },
    {
      path: '/order',
      component: Order
    },
    {
      path: '/profile',
      component: Profile
    },
    {
      path: '/food',
      component: Food
    },
    {
      path: '/shop/:id',
      component: Shop
    },
    {
      path: '/login',
      component: Login,
      redirect: '/login/note',
      children: [
        {
          path: 'note',
          component: Note
        },
        {
          path: 'password',
          component: Password
        }
      ]
    },
    {
      path: '/ulike',
      component: Ulike
    },
    {
      path: '/search',
      component: Search,
      redirect: '/search/searchTxt',
      children: [
        {
          path: 'searchTxt',
          component: SearchTxt
        },
        {
          path: 'searchList',
          component: SearchList
        }
      ]
    },
    {
      path: '/service/about',
      component: About
    }
  ]
})
